import Vue from "vue";
import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src
import { TABase } from "@/utils/types";

// Vue.extend 主要是辅助ts做类型检查和推断的
export default Vue.extend({
  name: "HomeView",
  components: {
    HelloWorld,
  },
  data() {
    let goods: ICouponItem[] | never[] = [];
    return {
      uname: "",
      goods,
    };
  },
  created() {
    let name: TABase = "小排名";
    this.uname = name;
    this.$request(
      "https://apif.java.crmeb.net/api/front/coupons?page=1&limit=6"
    ).then((data: ICoupon) => {
      this.goods = data.data as any;
    });
    this.$uname = "哈哈哈";
  },
});
